/*
 * Copyright (c) 2019 DawnFramework. All Rights Reserved.
 * Licensed under the MIT (LICENSE) license.
 */

package org.dawn.common.service.except;

import org.dawn.common.core.except.IError;

/**
 * @author Willard Hu on 2019-05-19.
 */
public class ApiException extends RuntimeException {
    private static final long serialVersionUID = 5693143714763038103L;

    private IError<Integer> error;

    public ApiException(IError<Integer> error) {
        super(error.errmsg());
        this.error = error;
    }

    public ApiException(IError<Integer> error, Throwable cause) {
        super(cause);
        this.error = error;
    }
}
